package com.gr.menuw.menu.item;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.link.AbstractLink;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;

/**
 * 
 * @author Graham Rhodes 30 Dec 2010 16:00:11
 */
public class LinkMenuItem extends AbstractMenuLink {

    private static final long serialVersionUID = 1L;
    private final Class<? extends WebPage> pageClass;

    public LinkMenuItem(String id, String label, Class<? extends WebPage> pageClass) {
        super(id, label);
        this.pageClass = pageClass;
    }

    /* (non-Javadoc)
     * @see com.gr.menuw.menu.item.AbstractMenuLink#newLink(java.lang.String)
     */
    @Override
    protected AbstractLink getLink(final String id) {
        return new BookmarkablePageLink<Void>(id, pageClass);
    }

    /* (non-Javadoc)
     * @see com.gr.menuw.menu.item.IMenuItem#show(boolean)
     */
    @Override
    public void show(boolean visible) {
        setVisible(visible);
    }

}
